﻿using System.Windows.Navigation;

namespace MyProject.Services.MyNavigation
{
    public class MyNavigationService
    {
        private System.Windows.Controls.Frame? _navigationFrame = null;

        public void setNavigationFrame(System.Windows.Controls.Frame frame)
        {
            if (this._navigationFrame != null)
            {
                throw new InvalidOperationException("Не возможно повторно создать привязку!");
            }
            this._navigationFrame = frame;
        }

        public void navigate(object page)
        {
            this._navigationFrame?.Navigate(page);
        }
    }
}
